<%--
  用户登录页面
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <c:import url="header.jsp"/>
</head>
<body id="body">
</body>
</html>
<c:import url="tmd_footer.jsp"/>
<script type="text/javascript" charset="utf-8">
    //跳转鉴权中心
    login();
    function login() {
        createForm("${authenticationUrl}", "${notifyUrl}", "${secret}","${sysCode}");
    }

    /**
     *
     * @param action 鉴权中心
     * @param notifyUrl 回调地址
     * @param authCode 加密授权字符串
     */
    function createForm(action, notifyUrl, secret,sysCode) {
        var myForm = $("<form></form>");
        myForm.attr('method', 'get');
        myForm.attr('action', action);

        var notifyUrlInp = $("<input type='hidden' name='notifyUrl' />")
        notifyUrlInp.attr('value', notifyUrl);
        myForm.append(notifyUrlInp);

        var authCodeInp = $("<input type='hidden' name='secret' />")
        authCodeInp.attr('value', secret);
        myForm.append(authCodeInp);

        var authCodeInp = $("<input type='hidden' name='sysCode' />")
        authCodeInp.attr('value', sysCode);
        myForm.append(authCodeInp);

        myForm.appendTo('body').submit(); //must add this line for higher html spec
    }

</script>
